package chapter1.domain.entity.vo;

import chapter1.util.DateTimeUtils;

import java.time.LocalDateTime;

/**
 * 视图对象类型-用户
 *
 * @author 郑植航
 * @since 2025/5/17 16:58
 */
public class UserVo extends BaseVo{

    //用户名
    public String username;
    //真实姓名
    public String name;
    //电话
    public String mobile;
    //邮箱
    public String email;
    //所属部门名称
    public String deptName;
    //所属角色名称
    public String roleName;
    //所属部门
    public Integer deptId;
    //所属角色
    public Integer roleId;
    public boolean enable = true;
    public UserVo() {
    }

    public UserVo(Integer id, LocalDateTime createAt, LocalDateTime updateAt, String username, String name, String mobile,
                  String email, String deptName, String roleName, Integer deptId, Integer roleId, boolean enable) {
        super(id, createAt, updateAt);
        this.username = username;
        this.name = name;
        this.mobile = mobile;
        this.email = email;
        this.deptName = deptName;
        this.roleName = roleName;
        this.deptId = deptId;
        this.roleId = roleId;
        this.enable = enable;
    }

    @Override
    public String toString() {
        return String.format("ID：%d，用户名：%s，姓名：%s，手机：%s，邮箱：%s，部门名称：%s，角色名称：%s，状态：%s，更新时间：%s",
                id,username,name,mobile,email,deptName,roleName,enable?"启用":"禁用", DateTimeUtils.format(updateAt));
    }

}
